from selenium import webdriver


# options = webdriver.ChromeOptions()
# options.add_experimental_option('excludeSwitches', ['enable-automation'])
# options.add_argument('--headless')
# browser = webdriver.Chrome(options=options)
# browser.get('https://www.zhipin.com/?ka=header-home')


class SenleniumA(object):
    options = webdriver.ChromeOptions()
    options.add_experimental_option('excludeSwitches', ['enable-automation'])
    options.add_argument('--headless')
    browser = webdriver.Chrome(options=options)
    browser.get('https://www.zhipin.com/?ka=header-home')

    # def __init__(self):
    #     options = webdriver.ChromeOptions()
    #     options.add_experimental_option('excludeSwitches', ['enable-automation'])
    #     options.add_argument('--headless')
    #     self.browser = webdriver.Chrome(options=options)

    def process_request(self):
        self.browser.get('https://www.baidu.com/')
        html = self.browser.page_source
        print(html)


a = SenleniumA()
a.process_request()

